package com.cljz.makepassenger.ui.holder;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;

import com.cljz.makepassenger.base.App;
import com.cljz.makepassenger.R;
import com.squareup.picasso.Picasso;

import java.io.File;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by apple on 2017/4/27.
 */

public class PicHolder extends RecyclerView.ViewHolder {

    @BindView(R.id.iv_pic)
    ImageView ivPic;
    @BindView(R.id.ib_delete)
    ImageButton ibDelete;

    public PicHolder(View itemView) {
        super(itemView);
        ButterKnife.bind(this, itemView);

    }

    public void setData(List<String> picList, int position) {
        File file = new File(picList.get(position));
        Picasso.with(App.getInstance())
                .load(file)
                .resize(140,140)
                .error(R.mipmap.activity_loading)
                .placeholder(R.mipmap.activity_loading)
                .into(ivPic);
    }
}
